package org.healer.simple_juc;

public class TestYield implements Runnable{

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"开始抢票");
//        Thread.yield();
        System.out.println(Thread.currentThread().getName()+"抢票结束");
    }

    public static void main(String[] args) {
        TestYield ty=new TestYield();
        new Thread(ty).start();
        new Thread(ty).start();
    }
}
